﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace pygs.Messaging.Transport
{
    public class FileTransporters
    {
        protected IList<FileCustomTransporter> transporters { get; private set; }

        public FileTransporters()
        {
            transporters = new List<FileCustomTransporter>();
        }

        public void RegisterTransporter(FileCustomTransporter transporter)
        {
            transporters.Add(transporter);
        }

        public FileCustomTransporter GetTransporter(Message message)
        {
            return transporters.Single(p => p.IsAcceptedFor(message));
        }
    }
}
